package com.cnc.bas.query;

import java.util.List;

/**
 * 
 * @author 阿闲
 * @date   Jun 12, 2007
 * @version 1.0
 */
public class PageInfo {

	private long currentPage;
	private int pageSize;
	private long totalPage = 0;
	
	private List pageData;	
	private long totalCount = 0;	
	
	public PageInfo(){
		this(1, 10);
	}
	
	public PageInfo(int start, int pageSize){
		this.currentPage = start;
		this.pageSize = pageSize;
	}
	public List getPageData() {
		return pageData;
	}
	public void setPageData(List pageData) {
		this.pageData = pageData;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		if(pageSize ==0) return;
		this.pageSize = pageSize;
	}
	public long getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(long currentPage) {
		this.currentPage = currentPage;
	}
	public long getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}
	public long getTotalPage() {
		
		if((totalCount%pageSize)==0) 
			return totalCount/pageSize;
		else
			return (totalCount/pageSize +1);
		
	}
	public void setTotalPage(long totalPage) {
		this.totalPage = totalPage;
	}
	

	
	
	
	
}
